package com.yf.springboot.controller;

import com.yf.springboot.service.ThreadPoolService;
import com.yf.springboot.service.ThreadPoolService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 自定义线程池侧是
 *
 * @Author gblfy
 * @Date 2022-04-05 17:54
 **/
@RestController
public class ThreadPoolController {

    private final ThreadPoolService threadPoolService;
    private final ThreadPoolService2 threadPoolService2;

    public ThreadPoolController(ThreadPoolService threadPoolService, ThreadPoolService2 threadPoolService2) {
        this.threadPoolService = threadPoolService;
        this.threadPoolService2 = threadPoolService2;
    }

    @GetMapping("/threadPoolTest")
    public void threadPoolTest() {
        threadPoolService.executeAsync();
        threadPoolService2.executeAsync();
    }
}